package com.zgroup.domain

class Company {
  String name         // 公司名称
  String telephone    // 联系电话
  String fax          // 联系传真
  String email        // 公司邮箱
  String address      // 公司地址
  String homePage     // 公司网页
  String introduction    //公司简介
  String showFlag = '1'  // 显示标记位 1：显示 0：不显示
  String approveFlag = '0'  // 审批通过标记 1：通过 0：不通过

  Estate estate
  User createUser
  User approveUser

  Date dateCreated
  Date lastUpdated

  static constraints = {
    name(nullable: true, maxSize: 20)
    telephone(nullable: true, matches: "[0-9]+", maxSize: 30)
    fax(nullable: true, matches: "^[+]{0,1}(\\d){1,3}[ ]?([-]?((\\d)|[ ]){1,12})+", maxSize: 30)
    email(nullable: true, email: true, maxSize: 50)
    address(maxSize: 255)
    homePage(maxSize: 255)
    approveFlag(maxSize: 6)
    showFlag(maxSize: 6)
    //estate(nullable:true)
    approveUser(nullable: true)

  }

  String toString() {
    "id:" + id + ",name:" + name
  }
}
